package com.feinno.urcs.group.entity;

import com.feinno.superpojo.type.EnumInteger;

/**
 * @author Li.Hongbo <lihongbo@feinno.com>
 */
public enum GroupOfflineMessageType implements EnumInteger {
    TEXT(1),
    INVITE(2),;

    private int value;

    private GroupOfflineMessageType(int value) {
        this.value = value;
    }

    @Override
    public int intValue() {
        return this.value;
    }

    public static GroupOfflineMessageType fromInt(int value) throws Exception {
        switch (value) {
            case 1:
                return TEXT;
            case 2:
                return INVITE;

            default:
                throw new Exception("GroupOfflineMessageType no value=" + value);
        }
    }
}
